package com.hung.hashMap;
/**
 * title:Test.java
 * author: hungki
 * createTime 18/8/17 下午 9:54
 * version v_1.0
 * Copyright @ 2018 复华创新事业部
 */

/**
 * className: Test 
 * describe: 
 * author: hungki  
 * createTime 18/8/17 下午 9:54 
 *
 */
public class HighestOneBitDemo {
    public static void main(String[] args) {
       int a = highestOneBit(5);
        System.out.println("a = " + a);
    }
    public static int highestOneBit(int i) {
        i |= (i >>  1);
        i |= (i >>  2);
        i |= (i >>  4);
        i |= (i >>  8);
        i |= (i >> 16);
        return i - (i >>> 1);
    }
}
